/* Live App 样式文件 - 直播应用 */

/* CSS变量定义 */
:root {
  --live-primary-pink: #fb7299;
  --live-danger-red: #ff4d4f;
  --live-button-gradient: linear-gradient(45deg, #fe8c8c 0%, #f7739a 100%);
  --live-danmaku-gift-bg: linear-gradient(90deg, rgba(251, 114, 153, 0.08), rgba(255, 221, 96, 0.08));
  --live-text-primary: #333333;
  --live-text-secondary: #888888;
  --live-text-system: #b2b2b2;
  --live-border-color: #ededf0;
  --live-button-bg: #f0f2f5;
  --live-modal-bg: #ffffff;
  --live-screen-bg: #f7f8fc;
}

/* 直播应用容器 */
.live-app {
  display: flex;
  flex-direction: column;
  height: 100%; /* 使用父容器高度，而不是视口高度 */
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 禁用直播应用的整体页面滚动条 */
.live-app .app-content,
.live-app #app-content {
  overflow: hidden !important; /* 禁用整体滚动 */
  height: 100% !important;
}

/* ==================== 观看直播界面 ==================== */

.watch-live-container {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%; /* 使用父容器的完整高度 */
  overflow-y: auto;
}

.watch-live-header {
  text-align: center;
  margin-bottom: 10px;
}

.watch-live-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--live-text-primary);
  margin-bottom: 8px;
}

.watch-live-header p {
  font-size: 14px;
  color: var(--live-text-secondary);
  margin: 0;
}

/* 观看选项 */
.watch-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.watch-option-btn {
  display: flex;
  align-items: center;
  padding: 20px;
  background: white;
  border: 2px solid var(--live-border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.watch-option-btn:hover {
  border-color: var(--live-primary-pink);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(251, 114, 153, 0.2);
}

.option-icon {
  font-size: 32px;
  margin-right: 16px;
}

.option-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--live-text-primary);
  margin-bottom: 4px;
}

.option-desc {
  font-size: 14px;
  color: var(--live-text-secondary);
}

/* ==================== 直播间列表界面 ==================== */

.live-list-container {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  overflow-y: auto;
}

.live-list-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.back-btn {
  background: none;
  border: 2px solid var(--live-border-color);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--live-text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.back-btn:hover {
  border-color: var(--live-primary-pink);
  color: var(--live-primary-pink);
}

.live-list-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--live-text-primary);
  margin: 0;
}

.live-rooms-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.live-room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: white;
  border: 2px solid var(--live-border-color);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.live-room-item:hover {
  border-color: var(--live-primary-pink);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(251, 114, 153, 0.2);
}

.room-info {
  flex: 1;
}

.room-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--live-text-primary);
  margin-bottom: 8px;
}

.room-details {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.room-details span {
  font-size: 14px;
  color: var(--live-text-secondary);
  background: var(--live-screen-bg);
  padding: 4px 8px;
  border-radius: 4px;
}

.watch-room-btn {
  padding: 12px 24px;
  background: var(--live-button-gradient);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(251, 114, 153, 0.3);
}

.watch-room-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(251, 114, 153, 0.4);
}

.no-rooms {
  text-align: center;
  padding: 40px;
  color: var(--live-text-secondary);
  font-size: 16px;
}

/* ==================== 弹窗样式 ==================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--live-border-color);
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--live-text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--live-text-secondary);
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: var(--live-border-color);
  color: var(--live-text-primary);
}

.modal-body {
  padding: 20px;
}

.input-section {
  margin-bottom: 20px;
}

.input-section label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--live-text-primary);
}

.input-section input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--live-border-color);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.input-section input:focus {
  outline: none;
  border-color: var(--live-primary-pink);
  box-shadow: 0 0 0 2px rgba(251, 114, 153, 0.2);
}

.watch-live-btn {
  width: 100%;
  padding: 12px 24px;
  background: var(--live-button-gradient);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(251, 114, 153, 0.4);
}

.watch-live-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(251, 114, 153, 0.5);
}

.watch-live-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(251, 114, 153, 0.4);
}

/* ==================== 观看直播间样式 ==================== */

.watch-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  align-items: center;
}

.watch-actions .interact-btn {
  font-size: 0.75rem;
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.watch-actions .interact-btn i {
  margin-right: 0.25rem;
}

/* ==================== 全新打赏礼物弹窗样式 ==================== */

.gift-modal-container {
  width: 95%;
  max-width: 48rem;
  aspect-ratio: 3 / 5;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.gift-modal-header {
  width: 100%;
  aspect-ratio: 8 / 1;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  box-sizing: border-box;
}

.gift-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2d3748;
  background: linear-gradient(45deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gift-modal-close {
  width: 2rem;
  aspect-ratio: 1;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #718096;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.gift-modal-close:hover {
  background: rgba(113, 128, 150, 0.1);
  color: #2d3748;
}

.gift-modal-body {
  flex: 1;
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.gift-list-container {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0;
  padding: 0.75rem;
  flex: 1;
  overflow-y: auto;
}

.gift-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.375rem;
}

.gift-card {
  background: white;
  border-radius: 0.375rem;
  padding: 0.375rem;
  border: 0.0625rem solid #e2e8f0;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.375rem;
}

.gift-card:hover {
  border-color: #667eea;
  transform: translateY(-0.125rem);
  box-shadow: 0 0.5rem 1rem rgba(102, 126, 234, 0.2);
}

.gift-card.selected {
  border-color: #667eea;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

.gift-icon {
  font-size: 1rem;
  width: 1.5rem;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  color: white;
  flex-shrink: 0;
}

.gift-info {
  text-align: left;
  flex: 1;
  min-width: 0;
}

.gift-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.0625rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gift-price {
  font-size: 0.625rem;
  color: #718096;
  font-weight: 500;
}

.gift-controls {
  display: flex;
  align-items: center;
  gap: 0.1875rem;
  flex-shrink: 0;
}

.qty-btn {
  width: 1.125rem;
  aspect-ratio: 1;
  border: 0.0625rem solid #e2e8f0;
  border-radius: 0.1875rem;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5625rem;
  font-weight: 600;
  color: #4a5568;
  transition: all 0.3s ease;
}

.qty-btn:hover {
  border-color: #667eea;
  color: #667eea;
}

.qty-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.qty-input {
  width: 1.75rem;
  height: 1.125rem;
  border: 0.0625rem solid #e2e8f0;
  border-radius: 0.1875rem;
  text-align: center;
  font-size: 0.5625rem;
  font-weight: 600;
  color: #2d3748;
  background: white;
}

.qty-input:focus {
  outline: none;
  border-color: #667eea;
}

.gift-message-section {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0;
  padding: 0.75rem;
  border-top: 0.0625rem solid rgba(255, 255, 255, 0.3);
}

.message-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

#gift-message-input {
  width: 100%;
  aspect-ratio: 6 / 1;
  border: 0.125rem solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 0.875rem;
  resize: none;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

#gift-message-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 0.1875rem rgba(102, 126, 234, 0.2);
}

.gift-summary {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 0;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 0.0625rem solid rgba(255, 255, 255, 0.3);
}

.total-amount {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.amount-label {
  font-size: 0.75rem;
  color: #718096;
  font-weight: 500;
}

.amount-value {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(45deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.send-gift-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  border-radius: 2rem;
  padding: 0.75rem 1.5rem;
  color: white;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 0.5rem 1rem rgba(102, 126, 234, 0.3);
}

.send-gift-btn:hover {
  transform: translateY(-0.125rem);
  box-shadow: 0 0.75rem 1.5rem rgba(102, 126, 234, 0.4);
}

.send-gift-btn:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 1rem;
}

.btn-text {
  font-size: 0.875rem;
}

/* 自定义互动区域 */
.custom-interaction-section {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.custom-interaction-section textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--live-border-color);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  resize: vertical;
  font-family: inherit;
  margin-bottom: 12px;
}

.custom-interaction-section textarea:focus {
  outline: none;
  border-color: var(--live-primary-pink);
  box-shadow: 0 0 0 2px rgba(251, 114, 153, 0.2);
}

/* 预设互动区域 */
.preset-interactions {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.preset-interactions h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--live-text-primary);
  margin-bottom: 12px;
  text-align: center;
}

.preset-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.preset-btn {
  background: var(--live-button-bg);
  border: 1px solid var(--live-border-color);
  color: var(--live-text-primary);
  padding: 12px 8px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  line-height: 1.3;
}

.preset-btn:hover {
  background: #e8eaf0;
  border-color: var(--live-primary-pink);
  color: var(--live-primary-pink);
}

.preset-btn:active {
  transform: scale(0.98);
}

/* ==================== 直播中界面 ==================== */

.live-container {
  display: flex;
  flex-direction: column;
  height: 100%; /* 使用父容器高度，即 calc(100% - 48px) */
  overflow: hidden; /* 禁用整体滚动 */
}

/* 视频框 */
.video-placeholder {
  width: calc(100% - 20px); /* 减少左右边距 30px → 20px */
  flex: 0 0 40%; /* 使用flex比例：占40%的高度 */
  background-color: #000;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80' width='80' height='80'%3E%3Crect fill='%23050505' width='80' height='80'/%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M10 10 L60 10 L60 60 L10 60 Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  border-radius: 10px; /* 减小圆角 12px → 10px */
  margin: 8px auto 0 auto; /* 减少上边距 15px → 8px */
  display: flex;
  flex-direction: column;
  justify-content: stretch; /* 让内容拉伸填满空间 */
  text-align: center;
  position: relative;
  padding: 6px 8px; /* 进一步减少内边距 */
  overflow: hidden; /* 确保内容不会溢出 */
}

.live-status-top {
  color: #fff;
  font-size: 14px;
  text-align: left;
  margin-bottom: 10px;
}

.live-content-text {
  color: #ffffff; /* 改为白色，提高可读性 */
  font-size: 15px; /* 稍微减小字体 16px → 15px */
  line-height: 1.5; /* 进一步减少行高 1.6 → 1.5 */
  margin: 0; /* 移除所有margin */
  transition: opacity 0.5s ease;
  padding: 0 6px 6px 6px; /* 只保留底部和左右padding */
  text-align: center;
  flex: 1; /* 让文本区域占用所有可用空间 */
  overflow-y: auto; /* 添加垂直滚动 */
  word-wrap: break-word; /* 自动换行 */
  word-break: break-all; /* 强制换行 */
  display: flex; /* 设置为flex容器 */
  align-items: flex-start; /* 垂直顶部对齐，确保开头不被隐藏 */
  justify-content: center; /* 水平居中内容 */
}

/* 直播内容文本滚动条样式 */
.live-content-text::-webkit-scrollbar {
  width: 4px;
}

.live-content-text::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.live-content-text::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.live-content-text::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.live-status-bottom {
  color: #fff;
  font-size: 13px; /* 减小字体 14px → 13px */
  font-weight: bold;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 5px; /* 减小间距 6px → 5px */
  transition: opacity 0.3s;
  margin-top: 0; /* 移除上边距，让内容更紧凑 */
}

.live-dot {
  width: 7px; /* 减小尺寸 8px → 7px */
  height: 7px; /* 减小尺寸 8px → 7px */
  background-color: var(--live-danger-red);
  border-radius: 50%;
  animation: breathing 1.5s infinite ease-in-out;
}

@keyframes breathing {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
}

/* 推荐互动面板 */
.interaction-panel {
  padding: 10px; /* 减少padding 15px → 10px */
  border-bottom: 1px solid var(--live-border-color);
  background: white;
  flex: 0 0 20%; /* 使用flex比例：占20%的高度 */
}

.interaction-panel h4 {
  font-size: 13px; /* 减小标题字体 */
  margin: 0 0 8px 0; /* 减少下边距 */
  color: var(--live-text-primary);
}

.interaction-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px; /* 减少下边距 15px → 10px */
}

.interaction-header h4 {
  font-size: 14px; /* 减小字体 16px → 14px */
  font-weight: bold;
  color: var(--live-text-primary);
  margin: 0;
}

.interact-btn {
  background: var(--live-button-gradient);
  border: none;
  color: #fff;
  padding: 6px 12px; /* 减少padding 8px 16px → 6px 12px */
  border-radius: 14px; /* 减小圆角 16px → 14px */
  font-size: 11px; /* 减小字体 12px → 11px */
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(251, 114, 153, 0.4);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 3px; /* 减小间距 4px → 3px */
}

.interact-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(251, 114, 153, 0.5);
}

.interact-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(251, 114, 153, 0.4);
}

.recommended-interactions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px; /* 减少间距 10px → 6px */
}

.rec-btn {
  background-color: var(--live-button-bg);
  border: 1px solid var(--live-border-color);
  color: var(--live-text-primary);
  padding: 8px; /* 减少padding 10px → 8px */
  border-radius: 6px; /* 减小圆角 8px → 6px */
  font-size: 12px; /* 减小字体 14px → 12px */
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  line-height: 1.2; /* 减少行高 1.3 → 1.2 */
}

.rec-btn:hover {
  background-color: #e8eaf0;
  border-color: var(--live-primary-pink);
  color: var(--live-primary-pink);
}

.rec-btn:active {
  transform: scale(0.98);
}

.no-interactions {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--live-text-secondary);
  font-style: italic;
  padding: 20px;
  margin: 0;
}

/* 弹幕容器 */
.danmaku-container {
  flex: 1; /* 使用剩余的所有空间（约35%） */
  padding: 15px;
  overflow-y: auto;
  /* scroll-behavior: smooth; 取消平滑滚动，改为瞬时跳转 */
  background: white;
  min-height: 0; /* 允许flex收缩 */
  display: flex; /* 设置为flex容器 */
  flex-direction: column; /* 垂直布局 */
}

.danmaku-container::-webkit-scrollbar {
  width: 6px;
}

.danmaku-container::-webkit-scrollbar-track {
  background: #f0f2f5;
  border-radius: 3px;
}

.danmaku-container::-webkit-scrollbar-thumb {
  background: #dcdfe6;
  border-radius: 3px;
}

.danmaku-container::-webkit-scrollbar-thumb:hover {
  background: #c0c4cc;
}

.danmaku-list {
  display: flex;
  flex-direction: column;
  gap: 8px; /* 减少间距 12px → 8px */
  flex: 1; /* 占用父容器的剩余空间 */
  min-height: 0; /* 允许收缩 */
}

.danmaku-item {
  max-width: 90%;
  animation: fadeIn 0.5s ease;
  font-size: 14px;
  line-height: 1.5;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 普通弹幕样式 */
.danmaku-item.normal .username {
  color: #1e90ff;
  font-weight: bold;
}

.danmaku-item.normal .content {
  color: var(--live-text-primary);
  margin-left: 8px;
  word-break: break-all;
}

/* 礼物弹幕样式 */
.danmaku-item.gift {
  display: inline-block;
  background: var(--live-danmaku-gift-bg);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(251, 114, 153, 0.2);
  font-size: 13px;
}

.danmaku-item.gift .username {
  color: var(--live-primary-pink);
  font-weight: bold;
}

.danmaku-item.gift .content {
  color: #efa51a;
  font-weight: bold;
  margin-left: 5px;
}

.danmaku-item.gift i {
  margin-right: 5px;
  color: var(--live-primary-pink);
}

.no-danmaku {
  text-align: center;
  color: var(--live-text-secondary);
  font-style: italic;
  padding: 40px 20px;
}

/* ==================== 弹窗样式 ==================== */

.modal {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--live-modal-bg);
  border-radius: 12px;
  padding: 25px;
  width: 85%;
  max-width: 400px;
  border: 1px solid var(--live-border-color);
  position: relative;
  animation: slideUp 0.3s ease-out;
  color: var(--live-text-primary);
  max-height: 80vh;
  overflow-y: auto;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 15px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--live-border-color);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--live-text-primary);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--live-text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background-color: #f5f5f5;
  color: var(--live-text-primary);
}

/* 礼物列表弹窗 */
.gift-list {
  list-style: none;
  max-height: 250px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
}

.gift-list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--live-border-color);
  font-size: 14px;
  line-height: 1.4;
}

.gift-list li:last-child {
  border-bottom: none;
}

.gift-list .username {
  color: var(--live-primary-pink);
  font-weight: bold;
}

.gift-list .gift-name {
  color: #e8a200;
  margin-left: 10px;
  font-weight: 500;
}

.no-gifts {
  text-align: center;
  color: var(--live-text-secondary);
  font-style: italic;
  padding: 20px 0;
}

/* 自定义互动表单 */
#interaction-form textarea {
  width: 100%;
  height: 80px;
  background-color: #fff;
  border: 1px solid var(--live-border-color);
  color: var(--live-text-primary);
  padding: 10px;
  border-radius: 8px;
  resize: none;
  margin-bottom: 15px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
}

#interaction-form textarea:focus {
  outline: none;
  border-color: var(--live-primary-pink);
  box-shadow: 0 0 0 2px rgba(251, 114, 153, 0.2);
}

.submit-btn {
  width: 100%;
  background: var(--live-button-gradient);
  border: none;
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(251, 114, 153, 0.4);
  transition: all 0.2s ease;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(251, 114, 153, 0.5);
}

.submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(251, 114, 153, 0.4);
}

/* ==================== 提示消息 ==================== */

.live-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  z-index: 10000;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  max-width: 300px;
  word-wrap: break-word;
}

.live-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.live-toast.info {
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

.live-toast.success {
  background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
}

.live-toast.error {
  background: linear-gradient(135deg, #e17055 0%, #d63031 100%);
}

.live-toast.warning {
  background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
}

/* ==================== 错误状态 ==================== */

.error-message {
  text-align: center;
  padding: 40px 20px;
  color: var(--live-text-secondary);
  background: white;
  border-radius: 12px;
  margin: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.error-message .error-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.error-message .error-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--live-text-primary);
}

.error-message .error-details {
  font-size: 14px;
  margin-bottom: 20px;
  color: var(--live-text-secondary);
}

/* ==================== 按钮禁用状态 ==================== */

button:disabled,
.rec-btn:disabled,
.preset-btn:disabled {
  cursor: not-allowed !important;
  opacity: 0.6 !important;
  box-shadow: none !important;
  transform: none !important;
}

button:disabled:hover,
.rec-btn:disabled:hover,
.preset-btn:disabled:hover {
  background: var(--live-button-bg) !important;
  border-color: var(--live-border-color) !important;
  color: var(--live-text-primary) !important;
  transform: none !important;
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 768px) {
  .watch-live-container,
  .live-list-container {
    padding: 16px;
    gap: 16px;
  }

  .live-room-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .room-details {
    gap: 12px;
  }

  .watch-room-btn {
    width: 100%;
  }

  .modal-content {
    width: 95%;
    margin: 10px;
  }

  .modal-body {
    padding: 16px;
  }

  .gift-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
  }

  .gift-item {
    padding: 12px;
  }

  .watch-actions {
    gap: 0.25rem;
  }

  .watch-actions .interact-btn {
    font-size: 0.625rem;
    padding: 0.375rem 0.5rem;
  }

  .watch-actions .interact-btn i {
    margin-right: 0.125rem;
  }

  .custom-interaction-section,
  .preset-interactions {
    padding: 12px;
  }

  .video-placeholder {
    /* 保持40%比例，只调整边距和内边距 */
    margin: 6px auto 0 auto; /* 减少上边距 */
    padding: 6px 10px; /* 进一步减少内边距 */
  }

  /* 中等屏幕直播内容文本 */
  .live-content-text {
    font-size: 14px; /* 减小字体 15px → 14px */
    line-height: 1.4; /* 减少行高 1.5 → 1.4 */
    margin: 0 0 4px 0; /* 减少底部边距 */
    padding: 0 4px; /* 减少左右padding */
  }

  .interaction-panel {
    /* 保持20%比例，只调整padding */
    padding: 8px; /* 进一步减少padding */
  }

  .danmaku-container {
    padding: 12px;
  }

  /* 中等屏幕弹幕字体和间距 */
  .danmaku-list {
    gap: 6px; /* 减小间距 8px → 6px */
  }

  .danmaku-item {
    font-size: 13px; /* 减小字体 14px → 13px */
  }

  .danmaku-item.gift {
    font-size: 12px; /* 减小礼物弹幕字体 13px → 12px */
  }

  /* 中等屏幕LIVE装饰 */
  .live-status-bottom {
    font-size: 12px; /* 减小字体 13px → 12px */
    gap: 4px; /* 减小间距 5px → 4px */
    margin-top: 0; /* 保持无上边距 */
  }

  .live-dot {
    width: 6px; /* 减小尺寸 7px → 6px */
    height: 6px; /* 减小尺寸 7px → 6px */
  }

  /* 中等屏幕推荐互动标题 */
  .interaction-header {
    margin-bottom: 8px; /* 减少下边距 10px → 8px */
  }

  .interaction-header h4 {
    font-size: 13px; /* 减小字体 14px → 13px */
  }

  .interact-btn {
    padding: 5px 10px; /* 减少padding 6px 12px → 5px 10px */
    font-size: 10px; /* 减小字体 11px → 10px */
    border-radius: 12px; /* 减小圆角 14px → 12px */
    gap: 2px; /* 减小间距 3px → 2px */
  }

  .modal-content {
    width: 90%;
    padding: 20px;
  }

  .preset-buttons {
    gap: 8px;
  }

  .recommended-interactions {
    gap: 8px;
  }

  .preset-btn,
  .rec-btn {
    padding: 6px 4px; /* 进一步减少padding */
    font-size: 11px; /* 进一步减小字体 12px → 11px */
  }
}

@media (max-width: 480px) {
  .watch-live-header h2 {
    font-size: 20px;
  }

  .preset-buttons {
    grid-template-columns: 1fr;
  }

  /* 推荐互动保持两列布局，通过缩小字体适应小屏幕 */
  .recommended-interactions {
    grid-template-columns: repeat(2, 1fr);
  }

  .video-placeholder {
    /* 保持40%比例，只调整边距和内边距 */
    margin: 4px auto 0 auto; /* 进一步减少上边距 */
    padding: 4px 8px; /* 进一步减少内边距 */
  }

  /* 小屏幕直播内容文本 */
  .live-content-text {
    font-size: 13px; /* 进一步减小字体 14px → 13px */
    line-height: 1.3; /* 进一步减少行高 1.4 → 1.3 */
    margin: 0 0 3px 0; /* 进一步减少底部边距 */
    padding: 0 3px; /* 进一步减少左右padding */
  }

  .interaction-panel {
    /* 保持20%比例，只调整padding */
    padding: 6px; /* 进一步减少padding */
  }

  .live-content-text {
    font-size: 13px; /* 进一步减小字体 */
    max-height: none; /* 允许完整显示内容，不限制高度 */
    line-height: 1.4; /* 调整行高 */
  }

  /* 小屏幕弹幕字体和间距 */
  .danmaku-list {
    gap: 5px; /* 进一步减小间距 6px → 5px */
  }

  .danmaku-item {
    font-size: 12px; /* 小屏幕进一步减小字体 13px → 12px */
  }

  .danmaku-item.gift {
    font-size: 11px; /* 小屏幕礼物弹幕字体 12px → 11px */
  }

  /* 小屏幕LIVE装饰 */
  .live-status-bottom {
    font-size: 11px; /* 进一步减小字体 12px → 11px */
    gap: 3px; /* 进一步减小间距 4px → 3px */
    margin-top: 0; /* 保持无上边距 */
  }

  .live-dot {
    width: 5px; /* 进一步减小尺寸 6px → 5px */
    height: 5px; /* 进一步减小尺寸 6px → 5px */
  }

  /* 小屏幕推荐互动标题 */
  .interaction-header {
    margin-bottom: 6px; /* 进一步减少下边距 8px → 6px */
  }

  .interaction-header h4 {
    font-size: 12px; /* 进一步减小字体 13px → 12px */
  }

  .interact-btn {
    padding: 4px 8px; /* 进一步减少padding 5px 10px → 4px 8px */
    font-size: 9px; /* 进一步减小字体 10px → 9px */
    border-radius: 10px; /* 进一步减小圆角 12px → 10px */
    gap: 2px; /* 保持间距 */
  }

  .modal-content {
    width: 95%;
    padding: 16px;
  }

  .gift-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
  }

  .gift-item {
    padding: 8px;
  }

  .gift-name {
    font-size: 11px;
  }

  .gift-price {
    font-size: 10px;
  }

  .quantity-btn {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }

  .watch-actions .interact-btn {
    font-size: 0.5rem;
    padding: 0.25rem 0.375rem;
  }

  .watch-actions .interact-btn i {
    margin-right: 0.0625rem;
  }

  .gift-modal-container {
    width: 95%;
    aspect-ratio: 2 / 4;
  }

  .gift-grid {
    gap: 0.25rem;
  }

  .gift-card {
    padding: 0.25rem;
  }

  .gift-icon {
    font-size: 0.875rem;
    width: 1.25rem;
  }

  .gift-name {
    font-size: 0.625rem;
  }

  .gift-price {
    font-size: 0.5rem;
  }

  .qty-btn {
    width: 1rem;
    font-size: 0.5rem;
  }

  .qty-input {
    width: 1.5rem;
    height: 1rem;
    font-size: 0.5rem;
  }
}

/* ==================== 加载动画 ==================== */

.live-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  font-size: 16px;
  color: var(--live-text-secondary);
}

.live-loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid #e0e0e0;
  border-top: 2px solid var(--live-primary-pink);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

/* 更新加载提示样式 */
.live-loading-update {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
  margin-top: 10px;
  background: rgba(255, 105, 180, 0.1);
  border-radius: 8px;
  font-size: 14px;
  color: var(--live-text-secondary);
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e0e0e0;
  border-top: 2px solid var(--live-primary-pink);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ==================== 滚动条美化 ==================== */

.watch-live-container::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
  width: 8px;
}

.watch-live-container::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.watch-live-container::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
}

.watch-live-container::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* ==================== 特殊效果 ==================== */

/* 按钮点击波纹效果 */
.submit-btn,
.interact-btn {
  position: relative;
  overflow: hidden;
}

.submit-btn::after,
.interact-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.submit-btn:active::after,
.interact-btn:active::after {
  width: 200px;
  height: 200px;
}

/* 焦点可见性 */
button:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--live-primary-pink);
  outline-offset: 2px;
}

/* 新增弹幕/礼物逐条出现效果 */
.danmaku-item.appear-init,
.gift-list li.appear-init {
  opacity: 0;
  transform: translateY(10px);
  display: none; /* 初始不占位，避免空白 */
}

.danmaku-item.appear-show,
.gift-list li.appear-show {
  opacity: 1;
  transform: translateY(0);
  display: block; /* 出现时占位 */
  transition: opacity 300ms ease, transform 300ms ease;
}
